<form name="form" novalidate>
	<div class="input-group input-group-sm form-group">
		<span class="input-group-addon">{{extractorModel.extractorModelExpression()}}</span>
		
		<select ng-show='extractorModel.lastOperation != null' ng-change='extractorModel.setLastOperationKind(extractorModel.lastOperation.kind)' ng-model='extractorModel.lastOperation.kind' ng-options='operationKind as operationKind for operationKind in accessOperationKinds' class="form-control input-sm" required></select>

		<span ng-if='extractorModel.lastOperation.kind=="object"' class="input-group-addon"></span>
		<select ng-if='extractorModel.lastOperation.kind=="object"' ng-change='extractorModel.lastOperation.property=""' ng-model='extractorModel.lastOperation.action' ng-options='objectAction as objectAction for objectAction in objectActions' class="form-control input-sm" required></select>
		<span ng-if='extractorModel.lastOperation.action=="propertyNamed"' class="input-group-addon"></span>
		<input ng-if='extractorModel.lastOperation.action=="propertyNamed"' name='property'  ng-model='extractorModel.lastOperation.property' placeholder="{{'valueExtractorPropertyInputPlaceholder' | translate}}" class="form-control" required></input>

		<span ng-if='extractorModel.lastOperation.kind=="array"' class="input-group-addon"></span>
		<select ng-if='extractorModel.lastOperation.kind=="array"' ng-change='extractorModel.lastOperation.position=""'  ng-model='extractorModel.lastOperation.action' ng-options='arrayAction as arrayAction for arrayAction in arrayActions' class="form-control input-sm" required></select>
		<span ng-if='extractorModel.lastOperation.action=="itemAtPosition"' class="input-group-addon"></span>
		<input ng-if='extractorModel.lastOperation.action=="itemAtPosition"' type='number' name='position' ng-model='extractorModel.lastOperation.position' placeholder="{{'valueExtractorPositionInputPlaceholder' | translate}}"  class="form-control" required></input>
												
	</div>
	<!-- <div class="validation-error" ng-show="form.property.$error.required">property required</div>
	<div class="validation-error" ng-show="form.position.$error.required">item position required</div>
	-->

	<button ng-show='extractorModel.lastOperation != null && !extractorModel.isTerminal(extractorModel.lastOperation.kind)' ng-disabled='form.$invalid' ng-click="extractorModel.addOperation()" type="button" class="btn btn-primary btn-xs pull-right"><span>{{'valueExtractorAddButton' | translate}}</span></button>
	<button ng-show='extractorModel.isTerminal(extractorModel.lastOperation.kind)' ng-click="extractorModel.doneAddingOperations()" type="button" class="btn btn-primary btn-xs pull-right"><span>{{'valueExtractorDoneButton' | translate}}</span></button>
	<button ng-show='extractorModel.accessOperations.length > 0' ng-click='extractorModel.popOperation()' type='button' class="btn btn-xs pull-right"><i  class="fa fa-undo" ></i></button>
</form>
